<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _query(self):
 """ perform a request to the API, only when necessary """


        if not self.urls:
            self._resp = {}

        elif self._resp is None:
            params = [ ('url', url) for url in self.urls]
            query = urllib.urlencode(params)

            # query API
            r = self.opener.open(BITLOVE_ENCLOSURE_API + query)
            self._resp = json.loads(r.read())