added functions to load json, updated load_nnetwork