const wrap = require('co-express');
const { ObjectID } = require('mongodb');

module.exports = (app, db) => {
  const storage = db.collection('storage');

  app.get(
    '/api/id/:id',
    wrap(function*(req, res, next) {
      const id = req.params.id;

      const data = yield storage.findOne({ _id: new ObjectID(id) });

      if (!data) {
        const err = new Error('Element not found in the database');
        err.status = 404;
        return next(err);
      }

      return res.send({
        error: false,
        data
      });
    })
  );
};

@@ -466,16 +466,420 @@
      %7D%0A%0A
+      return res.send(%7B%0A        error: false,%0A        data%0A      %7D);%0A    %7D)%0A  );%0A%0A  app.get(%0A    '/api/id/:id/nuke',%0A    wrap(function*(req, res, next) %7B%0A      const id = req.params.id;%0A%0A      const data = yield storage.remove(%7B _id: new ObjectID(id) %7D);%0A%0A      if (!data) %7B%0A        const err = new Error('Element not found in the database');%0A        err.status = 404;%0A        return next(err);%0A      %7D%0A%0A
       re

Fix deletion