[WIP] refactor modules to use flask