import json


def load_params(path):
    """Load and return gene library data from a json file. If the path does not
    exist (library being empty), create a new empty dictionary."""
    try:
        with open(path, "r") as infile:
            data = json.load(infile)
    except (IOError, ValueError):
        # If file fails to load, create new dictionary
        data = {"items": {}, "loc": {}}
    return data