error handling and finished the routes
error handling and adding to the routes