Made both save and load json and fixed tests