var httpfunc = require('topsin.httpfunc');
var REQ = httpfunc.argv().request;
var RES = httpfunc.argv().response;
var DBNAME = REQ.pathCapture('DBNAME');
var result = new (require('topsin.responsedata'))();
var logger = require("topsin.logger");

try {
  logger.error("I am Dirty!");
  result.setData({ name: "Hello Dirty!"});
  RES.body(result.toJson());
  logger.error("Bye!");
} catch (err) {
  result.setErrText(_.toString(err));
  RES.badRequest(result.toJson());
}