Replace response code check with class object check

When querying, the response return is of sublcass of HTTPResponse, thus we could check based on the subclass type