docs: private int parseTreeId(HttpQuery query, final boolean required) {
      try{
        if (required) {
          return Integer.parseInt(query.getRequiredQueryStringParam("treeid"));
        } else {
          if (query.hasQueryStringParam("treeid")) {
            return Integer.parseInt(query.getQueryStringParam("treeid"));
          } else {
            return 0;
          }
        }
      } catch (NumberFormatException nfe) {
        throw new BadRequestException("Unable to parse 'tree' value", nfe);
      }
    }