Fixes error handling by moving routes.py to correct folder