Moved getChallenges call to apilibrary