Move route handling to separate module. Handle URL query params.