Cleanup and first flask API
api v2: now with caching