def METHOD_NAME(check, resource, **kwargs):
    resource_url = RESOURCE_URL_MAP[resource].format(base_url=check.base_url, **kwargs)
    resource_name = " ".join(resource.split("_"))
    try:
        resp = check.http.get(resource_url)
        resp.raise_for_status()
        json_payload = resp.json()
        if resource == 'build_config' or resource == 'teamcity_server_details':
            return json_payload
        elif json_payload.get("count", 0) == 0:
            check.log.debug("No results found for resource %s url: %s", resource_name, resource_url)
            return {}
        else:
            check.log.debug("Results found for resource %s url: %s", resource_name, resource_url)
            return json_payload
    except requests.exceptions.HTTPError:
        if resp.status_code in (401, 403):
            check.log.error("Access denied. Enable guest authentication or check user permissions.")
        check.log.exception("Couldn't fetch resource %s, got code %s", resource_name, resp.status_code)
        raise
    except Exception as e:
        check.log.exception("Couldn't fetch resource %s, unhandled exception %s", resource_name, str(e))
        raise