var Roadmap = require('./roadmapModel.js'),
    handleError = require('../../util.js').handleError,
    handleQuery = require('../queryHandler.js');

module.exports = {

  createRoadmap : function (req, res, next) {
    var newRoadmap = req.body;
    Roadmap(newRoadmap).save()
      .then(function(dbResults){
        res.status(201).json(dbResults);
      })
      .catch(handleError(next));
  },

  getRoadmaps : function (req, res, next) {
    var dbArgs = handleQuery(req.query);

    Roadmap.find(dbArgs.filters, dbArgs.fields, dbArgs.params)
      .then(function(dbResults){
        res.json(dbResults);
      })
      .catch(handleError(next));
  },

  getRoadmapByID : function (req, res, next) {
    var _id = req.params.roadmapID;
    Roadmap.findById(_id)
      .then(function(dbResults){
        res.json(dbResults);
      })
      .catch(handleError(next));
  },

  updateRoadmap : function (req, res, next) {
    var _id = req.params.roadmapID;
    var updateCommand = req.body;
    Roadmap.findByIdAndUpdate(_id, updateCommand)
      .then(function(dbResults){
        res.json(dbResults);
      })
      .catch(handleError(next));
  },

  deleteRoadmap : function (req, res, next) {
    var _id = req.params.roadmapID;
    Roadmap.findByIdAndRemove(_id)
      .then(function(dbResults){
        res.json(dbResults);
      })
      .catch(handleError(next));
  }

};
@@ -1249,25 +1249,21 @@
 find
-ByIdAndRemov
+On
 e(
+%7B
 _id
+:_id%7D
 )%0A  
@@ -1277,35 +1277,72 @@
 en(function(
-dbResults)%7B
+roadmap)%7B%0A        if (roadmap) roadmap.remove();
 %0A        res
@@ -1343,33 +1343,31 @@
    res.json(
-dbResults
+roadmap
 );%0A      %7D)%0A

Refactor deleteRoadmap to use .remove() for Mongoose hook support