code: public static <T> Response call(String resource, S3RestUtils.RestCallable<T> callable) {
      try {
        // TODO(cc): reconsider how to enable authentication
        if (SecurityUtils.isSecurityEnabled(ServerConfiguration.global())
                && AuthenticatedClientUser.get(ServerConfiguration.global()) == null) {
          AuthenticatedClientUser.set(LoginUser.get(ServerConfiguration.global()).getName());
        }
      } catch (IOException e) {
        LOG.warn("Failed to set AuthenticatedClientUser in REST service handler: {}", e.getMessage());
        return createErrorResponse(new S3Exception(e, resource, S3ErrorCode.INTERNAL_ERROR));
      }
  
      try {
        return createResponse(callable.call());
      } catch (S3Exception e) {
        LOG.warn("Unexpected error invoking REST endpoint: {}", e.getErrorCode().getDescription());
        return createErrorResponse(e);
      }
    }
docs: Calls the given {@link S3RestUtils.RestCallable} and handles any exceptions thrown.
  
  @param <T> the return type of the callable
  @param resource the resource (bucket or object) to be operated on
  @param callable the callable to call
  @return the response object