Update app.py and templates