docs: private void handleBranch(TSDB tsdb, HttpQuery query) {
      if (query.getAPIMethod() != HttpMethod.GET) {
        throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, 
          "Unsupported HTTP request method");
      }
      
      try {
        final int tree_id = parseTreeId(query, false);
        final String branch_hex =
            query.getQueryStringParam("branch");
        
        // compile the branch ID. If the user did NOT supply a branch address, 
        // that would include the tree ID, then we fall back to the tree ID and
        // the root for that tree
        final byte[] branch_id;
        if (branch_hex == null || branch_hex.isEmpty()) {
          if (tree_id < 1) {
            throw new BadRequestException(
                "Missing or invalid branch and tree IDs");
          }
          branch_id = Tree.idToBytes(tree_id);
        } else {
          branch_id = Branch.stringToId(branch_hex);
        }
        
        // fetch it
        final Branch branch = Branch.fetchBranch(tsdb, branch_id, true)
          .joinUninterruptibly();
        if (branch == null) {
          throw new BadRequestException(HttpResponseStatus.NOT_FOUND, 
              "Unable to locate branch '" + Branch.idToString(branch_id) + 
              "' for tree '" + Tree.bytesToId(branch_id) + "'");
        }
        query.sendReply(query.serializer().formatBranchV1(branch));
        
      } catch (BadRequestException e) {
        throw e;
      } catch (IllegalArgumentException e) {
        throw new BadRequestException(e);
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }