Fix missing global $request and fix controller mock interface