Fix issue with setting proxy information

Also throw exceptions if invalid API key or httpclient provided