import requests
import json


def get(url, params=None):
    """ Performs a GET request to the given url with supplied params. If an error happens that will be printed to the
    console and None is returned """
    response = requests.get(url, params)
    if response.status_code == 200:
        return json.loads(response.text)
    else:
        print(
            f"Unable to perform REST call {url} with params {params}. Status {response.status_code}. Message: {response.text}")
        return None