Convert callback based api's to promise returning ones