code: function sendError(res,err) {
      console.error(err);
      // also log last executed query, for easier debugging
      console.error(lastQry.sql);
      res.statusCode = 500;
      res.send({
          result: 'error',
          err:    err
      });
  }
docs: Send error messsage to the user
  @param res
  @param err