Moving query routes to a query controller