Simplified flask code, compressed package into one api.py file