only write the count file if the API accepted it