finish get route for a query