Change of the mongo db name.
Error and status now returned in JSON and removed deplicated code.