Rewrite the API to be thread safe, use urllib3.