start making it all work
move the api into the main flask app