 
   clientId                       = getClientId req, res
 
-  { JUser, JGroup, JInvitation, JTeamInvitation } = koding.models
+  { JUser, JGroup, JInvitation } = koding.models
 
   return handleClientIdNotFound res, req  unless clientId
 


  queue = [

    ->
      { teamAccessCode } = body
      # if we dont have teamaccesscode just continue

      validateTeamInvitation = validateTeamInvitationKallback res, queue
      JTeamInvitation.byCode teamAccessCode, validateTeamInvitation

    ->
      koding.fetchClient clientId, context, (client_) ->

        client = client_

        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
        next()

    (next) ->
      # checking if user exists by trying to login the user
      JUser.login client.sessionToken, body, (err, result) ->
        errorMessage          = err?.message
