if (req.headers['content-type']) {
    if(req.headers['content-type'].indexOf("application/json") < 0) {
      err = new Error();
      err.status = 400;
      err.error = "Invalid content type";