Refactored API class by using  generics to allow different return types for abstract getAPIData method.