added promise API example