docs: @Override
    public void execute(TSDB tsdb, HttpQuery query) throws IOException {
      // the uri will be /api/vX/tree/? or /api/tree/?
      final String[] uri = query.explodeAPIPath();
      final String endpoint = uri.length > 1 ? uri[1] : ""; 
      
      try {
        if (endpoint.isEmpty()) {
          handleTree(tsdb, query);
        } else if (endpoint.toLowerCase().equals("branch")) {
          handleBranch(tsdb, query);
        } else if (endpoint.toLowerCase().equals("rule")) {
          handleRule(tsdb, query);
        } else if (endpoint.toLowerCase().equals("rules")) {
          handleRules(tsdb, query);
        } else if (endpoint.toLowerCase().equals("test")) {
          handleTest(tsdb, query);
        } else if (endpoint.toLowerCase().equals("collisions")) {
          handleCollisionNotMatched(tsdb, query, true);
        } else if (endpoint.toLowerCase().equals("notmatched")) {
          handleCollisionNotMatched(tsdb, query, false);
        } else {
          throw new BadRequestException(HttpResponseStatus.NOT_FOUND, 
              "This endpoint is not supported");
        }
      } catch (BadRequestException e) {
        throw e;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }