public Response buildResponse(int status) {
    return Response.status(status)
      .entity(map)
      .type(MediaType.APPLICATION_JSON)
      .build();
  }
Turn the map back to response object.
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/JsonBuilder.java