updated to asyncronous api