fix bugs from api calls