public final function beforeCallActionHandler(\SS_HTTPRequest $request, $action) {
        $id = $request->param(\Config::inst()->get('NestedResourceRestController', 'root_resource_id_field'));
        if(!$id) {
            throw new RestUserException(static::$no_id_message, static::$no_id_message);
        }
        $resource = $this->getRootResource($id);
        if(!$resource) {
            \SS_Log::log("NoResourceError was not handled inside the controller", \SS_Log::WARN);
            throw new RestSystemException("NoResourceError was not handled inside the controller", 501);
        }
        // call the action and inject the root resource
        return $this->$action($request, $resource);
    }