Added error handling for external testing when api_key.py is not available