<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def api_request(path, **kwargs):
 """Make an API request to the Hub to reduce boilerplate repetition. """


    url = url_path_join(os.environ['JUPYTERHUB_API_URL'], path)
    client = AsyncHTTPClient()
    headers = {
        'Authorization': 'token %s' % os.environ['JUPYTERHUB_API_TOKEN'],
    }
    if kwargs.get('method') == 'POST':
        kwargs.setdefault('body', '')
    req = HTTPRequest(url, headers=headers, **kwargs)
    return client.fetch(req)