Another fix for the api code