added test hook for api_count