Examples using the promises api.