Fixed bugs introduced by refactoring apDataService.