Use PyAemException instead of generic exception for custom exceptions.
Replace python requests with pycurl.