Updated api to use async callbacks