Update api.py

Fixed cloudflare issue by using urlib2 to make the request with a user-agent.