code: public ChannelFuture respondJson(Object ref) throws Exception {
          final String json = jsonObjectMapper.writeValueAsString(ref);
          return respondText(json, "application/json");
      }
docs: Converts the given Java object to JSON object using Jackson ObjectMapper,
  and responds it.
  If you just want to respond a text with "application/json" as content type,
  use respondJsonText(text).
  <p>
  Content-Type header is set to "application/json".
  "text/json" would make the browser download instead of displaying the content.
  It makes debugging a pain.