def METHOD_NAME(response, api_timeout=None, headers=None, timeout=None):
    """
    :param response: request
    :param api_timeout: asynchronous API timeout (will wait forever or until error if None)
    :param headers: request headers
    :param timeout: connect timeout
    :return: request
    """
    logger = logging.getLogger(__name__)
    location_uri = response.headers.get("Location")
    if location_uri is None:
        raise Exception(f"no Location header in {response}")
    start_time = time.time()
    if api_timeout is None:
        while True:
            done, response = call_finished(location_uri, headers, timeout)
            if done:
                break
            time.sleep(1)
    else:
        for _ in range(api_timeout):
            done, response = call_finished(location_uri, headers, timeout)
            if done:
                break
            time.sleep(1)
    if response.status_code == 202:
        wait_time = time.time() - start_time
        logger.warn(f"API request still not completed after {int(wait_time)} seconds: {response}")
        return response
    logger.debug(f"DELETE API call to {location_uri}")
    requests.delete(location_uri, headers=headers, proxies=get_proxies(location_uri), timeout=timeout)
    return response