fixes to use the api object