                             events[eventName] = {}
                         subscriber.addSubscriptions(events)
 
-                    res.header 'Location', "/getToken/#{subscriber.id}"
-                    res.json {}, if created then 201 else 200
+                    generateResponse subscriber, (result)->
+                        res.json result, 200
 
         catch error
             logger.error "Creating token failed: #{error.message}"

                            events[eventName] = {}
                        subscriber.addSubscriptions(events)

                    res.header 'Location', "/getToken/#{subscriber.id}"
                    res.json {}, if created then 201 else 200

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

                    events[eventName] = {}
                req.subscriber.addSubscriptions(events)
                
            generateResponse req.subscriber, (result)->
                res.json result, 200

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