load api before fetch coredata