Merge remote-tracking branch 'github/pr/13'
diff --git a/src/global_changes_epi.erl b/src/global_changes_epi.erl
new file mode 100644
index 0000000..5d8cbf9
--- /dev/null
+++ b/src/global_changes_epi.erl
@@ -0,0 +1,51 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(global_changes_epi).
+
+-behaviour(couch_epi_plugin).
+
+-export([
+    app/0,
+    providers/0,
+    services/0,
+    data_subscriptions/0,
+    data_providers/0,
+    processes/0,
+    notify/3
+]).
+
+app() ->
+    global_changes.
+
+providers() ->
+    [
+        {chttpd_handlers, global_changes_httpd_handlers}
+    ].
+
+
+services() ->
+    [
+        {global_changes, global_changes_plugin}
+    ].
+
+data_subscriptions() ->
+    [].
+
+data_providers() ->
+    [].
+
+processes() ->
+    [].
+
+notify(_Key, _Old, _New) ->
+    ok.
diff --git a/src/global_changes_sup.erl b/src/global_changes_sup.erl
index aed424e..13394ea 100644
--- a/src/global_changes_sup.erl
+++ b/src/global_changes_sup.erl
@@ -24,10 +24,9 @@
 
 
 init([]) ->
-    couch_epi:register_service(global_changes),
     global_changes_config_listener:subscribe(),
     {ok, {
-        {one_for_one, 5, 10}, [
+        {one_for_one, 5, 10}, couch_epi:register_service(global_changes_epi, [
             {
                 global_changes_server,
                 {global_changes_server, start_link, []},
@@ -35,7 +34,5 @@
                 5000,
                 worker,
                 [global_changes_server]
-            },
-            chttpd_handlers:provider(
-                global_changes, global_changes_httpd_handlers)
-    ]}}.
+            }
+    ])}}.