<commit_before>'use strict';

/**
 * Module dependencies.
 */
var errorHandler = require('../errors'),
	mongoose = require('mongoose'),
	User = mongoose.model('Event');

exports.getStartDate = function(req, res) {
	var id = req.body.session.id;
	var eventName = req.body.eventName;
	var query = Event.findOne({name: eventName});
	var theResult;
	var err;
	query.exec(function(err,result) {
		theResult = result;
		err = err;
		if (err) res.status(400).send(theError);
		else if (!theResult) res.status(400).json({start_date: "No start date!"});
		else res.status(200).json({start_date: theResult.start_date});
	});

exports.getEndDate = function(req, res) {
	var id = req.body.session.id;
	var eventName = req.body.eventName;
	var query = Event.findOne({name: eventName});
	var theResult;
	var err;
	query.exec(function(err,result) {
		theResult = result;
		err = err;
		if (err) res.status(400).send(theError);
		else if (!theResult) res.status(400).json({end_date: "No end date!"});
		else res.status(200).json({end_date: theResult.end_date});
	});

exports.getLocation = function(req, res) {
	var id = req.body.session.id;
	var eventName = req.body.eventName;
	var query = Event.findOne({name: eventName});
	var theResult;
	var err;
	query.exec(function(err,result) {
		theResult = result;
		err = err;
		if (err) res.status(400).send(theError);
		else if (!theResult) res.status(400).json({location: "No location!"});
		else res.status(200).json({location: theResult.location});
	});
<commit_msg>Added more routes, no tests written yet.<commit_after>'use strict';

/**
 * Module dependencies.
 */
var errorHandler = require('../errors'),
	mongoose = require('mongoose'),
	User = mongoose.model('Event');

exports.getStartDate = function(req, res) {
	var id = req.body.session.id;
	var eventName = req.body.eventName;
	var query = Event.findOne({name: eventName});
	var theResult;
	var err;
	query.exec(function(err,result) {
		theResult = result;
		err = err;
		if (err) res.status(400).send(theError);
		else if (!theResult) res.status(400).json({start_date: "No start date!"});
		else res.status(200).json({start_date: theResult.start_date});
	});

exports.getEndDate = function(req, res) {
	var id = req.body.session.id;
	var eventName = req.body.eventName;
	var query = Event.findOne({name: eventName});
	var theResult;
	var err;
	query.exec(function(err,result) {
		theResult = result;
		err = err;
		if (err) res.status(400).send(theError);
		else if (!theResult) res.status(400).json({end_date: "No end date!"});
		else res.status(200).json({end_date: theResult.end_date});
	});

exports.getLocation = function(req, res) {
	var id = req.body.session.id;
	var eventName = req.body.eventName;
	var query = Event.findOne({name: eventName});
	var theResult;
	var err;
	query.exec(function(err,result) {
		theResult = result;
		err = err;
		if (err) res.status(400).send(theError);
		else if (!theResult) res.status(400).json({location: "No location!"});
		else res.status(200).json({location: theResult.location});
	});

exports.getEventObj = function(req, res) {
	var id = req.body.session.id;
	var eventName = req.body.eventName;
	var query = Event.findOne({name: eventName});
	var theResult;
	var err;
	query.exec(function(err,result) {
		theResult = result;
		err = err;
		if (err) res.status(400).send(theError);
		else if (!theResult) res.status(400).json({message: "No such object!"});
		else res.status(200).json(theResult);
	});

exports.getSchedule = function(req, res) {
	var id = req.body.session.id;
	var eventName = req.body.eventName;
	var query = Event.findOne({name: eventName});
	var theResult;
	var err;
	query.exec(function(err,result) {
		theResult = result;
		err = err;
		if (err) res.status(400).send(theError);
		else if (!theResult) res.status(400).json({schedule: "No schedule!"});
		else res.status(200).json({schedule: theResult.schedule});
	});


{'fraction_non_alphanumeric': 0.16997167138810199, 'fraction_numerical': 0.01854236415142931, 'mean_word_length': 4.728613569321534, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3135418', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1373, 'n_words': 304}