update route.php to return response object

the previous code didn't quite work for me, this seems to be fine.