Abstracting APIService.java to work with all endpoints