         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

          # TODO: tying things like @formatEntity and saveChangesToDocument don't make sense
          # associated with the handler, because the handler might return a different type
          # of model, like in this case. Refactor to move that logic to the model instead.

  getFeedback: (req, res, id) ->
    @getDocumentForIdOrSlug id, (err, level) =>


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

