Make api_key and api_secret thread safe