add flask setup and helper methods