update to use the api