Update state2json to upstream