 
 uuid = require './uuid'
 
-generateResponse = (subscriber, cb) ->
+generateResponse = (req, res, subscriber) ->
     subscriber.getSubscriptions (subs) ->
         if subs?
             result = {}

                        eventName = eventName + "|" + req.param("steedosId").replace("@", "_").replace(".", "_")
                    events[eventName] = {}
                req.subscriber.addSubscriptions events, (r) ->
                    generateResponse req.subscriber, (result)->
                        res.json result, 200

        catch error
            logger.error "registerTopics failed: #{error.message}"

                                eventName = eventName + "|" + req.param("steedosId").replace("@", "_").replace(".", "_")
                            events[eventName] = {}
                        subscriber.addSubscriptions events, (r) ->
                            generateResponse(req, res, subscriber)

        catch error
            logger.error "Creating token failed: #{error.message}"
