save units in json as well