Refactored ApiHelper