         initVals = sessionQuery
         initVals.state = {complete:false, scripts:{currentScript:null}} # will not save empty objects
         initVals.permissions = [{target:req.user.id, access:'owner'}, {target:'public', access:'write'}]
+        initVals.team = req.query.team if req.query.team
         session = new Session(initVals)
         session.save (err) =>
           return @sendDatabaseError(res, err) if err


  getByRelationship: (req, res, args...) ->
    return @getSession(req, res, args[0]) if args[1] is 'session'
    return @getFeedback(req, res, args[0]) if args[1] is 'feedback'
    return @sendNotFoundError(res)


        level: {original: level.original.toString(), majorVersion: level.version.major}
        creator: req.user.id
      }

      sessionQuery.team = req.query.team if req.query.team
      
      Session.findOne(sessionQuery).exec (err, doc) =>
        return @sendDatabaseError(res, err) if err
        if doc
