def success(self, response=None, status_code=200, user_message=None,
              dev_message=None):
     self.set_header("Content-Type", "application/json; charset=UTF-8")
     if user_message is not None:
         self.set_header("X-User-Message", user_message)
     if dev_message is not None:
         self.set_header("X-Dev-Message", dev_message)
     self.write(JSONParser.to_json(response))
 def _json(self, status_code, message, data):
     self.set_header("Content-Type", "application/json; charset=UTF-8")
     response = JSONParser.to_json({"status": status_code,
                                    "message": message, "data": data})
     self.write(response)