private void handleRequest(HttpServletRequest request, HttpServletResponse response) throws IOException {
    String path = request.getPathInfo();
    System.out.println(request.toString());

    ApiController<?, ?> controllerFactory = controllers.get(path);

    if (controllerFactory == null) {
      controllerFactory = helpController;
    }
    HttpApiRequest apiRequest = new HttpApiRequest(request);
    ApiController<?, ?> controller = controllerFactory.createController();
    controller.setRequest(apiRequest);

    ApiResult apiResponse = controller.genResult();
    apiResponse.writeResponse(request, response);
  }