Added guard, replaced httparty with httpclient