         return res.status(500).send 'an error occured'  if err
         return res.status(403).send "Sorry,
           Team URL '#{slug}.#{hostname}' is already in use"  if group
-        queue.next()
-
-    ->
+        next()
+
+    (next) ->
       # checking if user exists by trying to login the user
       JUser.login client.sessionToken, body, (err, result) ->
         errorMessage          = err?.message


  clientId                       = getClientId req, res

  { JUser, JGroup, JInvitation, JTeamInvitation } = koding.models

  return handleClientIdNotFound res, req  unless clientId



  ]

  async.series queue


validateTeamInvitation = (teamAccessCode, callback) ->

  { JTeamInvitation } = koding.models
  JTeamInvitation.byCode teamAccessCode, (err, invitation) ->
    return callback err.message                     if err
    return callback 'Team Invitation is not found'  if not invitation
    return callback 'Team Invitation is not valid'  if not invitation.isValid()
    return callback null


createGroupKallback = (client, req, res, body) ->
