<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _send_message(self, method, endpoint, params=None, data=None):
 """Send API request. Args: method (str):
 HTTP method (get, post, delete, etc.) endpoint (str):
 Endpoint (to be added to base URL) params (Optional[dict]):
 HTTP request parameters data (Optional[str]):
 JSON-encoded string payload for POST Returns: dict/list: JSON response """

        url = self.url + endpoint
        r = self.session.request(method, url, params=params, data=data,
                                 auth=self.auth, timeout=30)
        return r.json()