added flask api and database adapter