Add conversion to json and back