Rewrote API to be async