updating to use the api instead of the cpi functions