handle httparty response properly