Update queryString function and check status code