     sendApiError res, apiErrors.invalidInput
     return
 
-  if not token and not token = getToken req
-    sendApiError res, apiErrors.unauthorizedRequest
-    return
+  token ?= getToken req
 
   return { model, id, method, token }
 


      context         = getContextFromSession session
      constructorName = getConstructorName model, Models

      unless constructorName
        sendApiError res, apiErrors.invalidInput

      return callback apiErrors.unauthorizedRequest

    if session

      if session.isGuestSession()
        session.remove()
        return callback apiErrors.unauthorizedRequest

      if session.getAt 'sessionData.apiSession'
        Models.JApiToken.fetchGroup (session.getAt 'groupName'), (err) ->
