 
       return
 
-    Models.JApiToken.createSessionByToken token, (err, session) ->
+    api.JApiToken.createSessionByToken token, (err, session) ->
 
       if err or not session
         return callback apiErrors.unauthorizedRequest

    callback null, session


fetchSession = (Models, options, callback) ->

  { token } = options

  unless token

    Models.JSession.createSession options, (err, res) ->
      if err or not res?.session
        return callback apiErrors.unauthorizedRequest



    return

  api.JSession.one { clientId: token }, (err, session) ->

    if err
      return callback apiErrors.unauthorizedRequest
