Routing

convert to routing
Use $request here and above.