Fixed API calls and test