code: public static void serialise(HttpServletResponse response,
                                   Object responseMessage) throws IOException {
  
          response.setContentType("application/json");
          response.setCharacterEncoding(StandardCharsets.UTF_8.name());
          serialise(response.getOutputStream(), responseMessage);
      }
docs: Serialises the given object to Json and writes it to the given
  {@link HttpServletResponse}.
  
  @param response        The http response to serialise to.
  @param responseMessage The message to be serialised.
  @throws IOException If an error occurs in writing the output.