Improved API authentication and testing