overhaul for GAE and flask