Replaced run_simple() with app.run() and added PROPAGATE_EXCEPTIONS.