add flask & flask-peewee to requirements
refactors db access