 
 		res.json({success: true, data: data.courses})
 
-studentsRouter.get '/explore/:term/:program/:courseId', (req, res)->
+studentsRouter.get '/explore/:term/:program/:courseId', (req, res, next)->
 
 	opts = {
 		pid: req.svu.program.id

	req.studentObject.get 'choose_class', opts, (err, data)-> res.json({success: true})


studentsRouter.get '/explore/:term/:program', (req, res)->
	#console.log data.programsByCode[req.params.program].id
	req.studentObject.get 'progtermcourse', {pid: req.svu.program.id}, (err, data)->
		return next(err) if err

	req.svu.term = data.termsByCode[req.params.term]
	next()

studentsRouter.get '/select/:program', (req, res, next)->
	req.studentObject.get 'get_selectable_classes', {pid: req.svu.program.id}, (err, data)->
		return next(err) if err
		res.json({success: true, data: data})

studentsRouter.get '/select/:program/:courseId', (req, res, next)->

	opts= {
		pid: req.svu.program.id,
