Apple admits giving governments access to thousands of iPhones and other devices