Move query route into its own file

Signed-off-by: Ian Macalinao <me@ian.pw>