Refactoring and fixes
Created by: mguijarr
Here are a few fixes and some refactoring. See commits messages for more details.
Highlight: I set up an exception handler so we don't need to do try...except in all our routes, and I changed the code in routes accordingly.