   queue = [
 
     ->
-      validateData { token, username }, (err, data) ->
+      validateData { token, username, suggestedUsername }, (err, data) ->
         return sendApiError res, err  if err
         { username, apiToken } = data
         queue.next()

validateData = (data, callback) ->

  { JUser, JGroup, JApiToken } = koding.models
  { token, username }          = data

  apiToken = null


validateRequest = (req) ->

  token = null
  { username, suggestedUsername, email, firstName, lastName } = req.body

  unless email
    return { error : apiErrors.invalidInput }

  unless username or suggestedUsername
    return { error : apiErrors.invalidInput }

  unless token = checkAuthorizationBearerHeader req
    return { error : apiErrors.unauthorizedRequest }

  return { error : null, token, username, email, firstName, lastName, suggestedUsername }

