code: def _maybe_handle(self, prefix, handler, path, params, data=None):
      
      if path.startswith(prefix):
        relpath = path[len(prefix):]
        if data:
          handler(relpath, params, data)
        else:
          handler(relpath, params)
        return True
      else:
        return False
docs: Apply the handler if the prefix matches.