     @_app.use helmet()
     @_app.use cors()
 
-    @_app.get '/notify', (req, res) =>
-      res.send """
-        <pre>
-          NotificationWorker #{argv.i ? 0} is #{if @isReady() then '' else 'not '}ready
-          Connections: #{JSON.stringify @_verifiedConnections}
-          Routes: #{JSON.stringify @_verifiedRoutes}
-        </pre>
-      """
-
-    @_app.post '/notify/send', @_handleSendNotification.bind this
+    @_app.get  '/notify',                  @_handleStatusRequest.bind this
+    @_app.post '/dispatcher_notify_user',  @_handleSendNotification 'user'
+    @_app.post '/dispatcher_notify_group', @_handleSendNotification 'group'
+
+    return @_app
 
 
   _startServer: ->

    @_verifiedConnections = []
    @_verifiedRoutes = []


  start: ->

    @log 'starting worker...'

    @_connection = amqp.createConnection KONFIG.mq, { reconnect: yes }


  _handleSocketMessage: (connection, message) ->

    @log 'got socket message', message
    @_proccessSocketMessage connection, message


  _proccessSocketMessage: (connection, message) ->

    if connection.id not in @_verifiedConnections

      @log 'connection not verified, checking...'
      [ err, parsedMessage ] = @_parseMessage message

      if err or not parsedMessage?.auth?
        @_dropConnection connection

      else
        { clientId, username, groupName } = parsedMessage.auth

        if /^guest-/.test username
          return @_dropConnection connection

        @_bongo.models.JSession.one { clientId, username, groupName }, (err, session) =>
          if err or not session
            @_dropConnection connection
          else
            @_verifyConnection connection, groupName, username
            @_ackConnection connection

    else
      @_ackConnection connection


  _ackConnection: (connection) ->

    connection.write '{ "auth": "ok" }'


  # --- socker connection management

  _verifyConnection: (connection, group, user) ->

    @_verifiedConnections.push connection.id
    @_verifiedRoutes.push [ group, user, connection.id ]
    @log 'connection verified now, welcome!', connection.url

    return connection


  _dropConnection: (connection) ->

    connection.close()
    return  unless @_connections[connection.id]

    @_verifiedConnections = @_verifiedConnections.filter (connectionId) ->
      connection.id isnt connectionId

    @_verifiedRoutes = @_verifiedRoutes.filter (route) ->
      [ ... , connectionId ] = route
      connection.id isnt connectionId

    delete @_connections[connection.id]
    @log 'connection dropped. goodbye!', connection.url

    return null


  # --- generic parser for stringified json

  _parseMessage: (message) ->

