Fixing minor issues with API call