smart proxy discovery

Handled errors and error codes in the discovery_api.rb (See https://github.com/shlomizadok/smart_proxy_discovery/commit/01db03e49491d60c200634d2c919b5de4a370183#diff-5ecdbedbf2bcecb6f98771eaf83e5211R42)