API wrapper to interact with flask