Exported the response object and refactored to better routes