code: public static void makeJsonResponse(HttpResponse response, String encoded) {
          StringEntity ent = new StringEntity(encoded, ContentType.APPLICATION_JSON);
          response.setEntity(ent);
      }
docs: Sets a JSON encoded response. The response's {@code Content-Type} header will be set to {@code application/json}
  @param response The response object
  @param encoded The JSON-encoded string