   app.use cors()
 
   app.post '/xhr', koding.expressify()
-  app.get '/xhr',(req,res)->
-    res.send "Socialworker is OK"
+  app.get '/xhr', (req, res) ->
+    res.send 'Socialworker is OK'
 
-  app.get '/version',(req,res)->
+  app.get '/version', (req, res) ->
     res.send "#{KONFIG.version}"
 
-  app.get '/healthCheck',(req,res)->
+  app.get '/healthCheck', (req, res) ->
     res.send "Socialworker is running with version: #{KONFIG.version}"
 
   app.listen argv.p
+
+

  # create default roles for groups
  JGroupRole = require './models/group/role'

  JGroupRole.createDefaultRoles (err)->
    if err then console.log err.message
    else console.log "Default group roles created!"

  if KONFIG.misc?.claimGlobalNamesForUsers
    require('./models/account').reserveNames console.log

    fetchClient: (name, context, callback) ->
      { JAccount } = koding.models
      [callback, context] = [context, callback] unless callback
      context   ?= { group: 'koding' }
      callback  ?= ->
      JAccount.one { 'profile.nickname': name }, (err, account) ->
        return callback err  if err?

        if account instanceof JAccount
          callback null, { context, connection: { delegate : account } }

  fetchClient: (sessionToken, context, callback) ->

    { JUser, JAccount } = koding.models
    [callback, context] = [context, callback] unless callback
    callback            ?= ->

    JUser.authenticateClient sessionToken, (err, res = {}) ->

      { account, session } = res

      context ?= { group: session?.groupName ? 'koding' }

      if err
        console.error 'bongo.fetchClient', { err, sessionToken, context }
        koding.emit 'error', err

      else if account instanceof JAccount
