def getEndpoint(endpoint):
    r = requests.get("http://localhost:80/api/{}".format(endpoint))
    if r.status_code != 200:
        raise Exception("Bad status code for endpoint {}: {}".format(endpoint, r.status_code))
    return r.json()