import json


def is_legal_json(to_check):
    """ Ckeck whether object is legal JSON. """
    try:
        json_object = json.loads(to_check)
    except ValueError:
        return False
    return True