turn api into async calls (work in progress)