Update API to use promises