Cleaning routes and error handling