json: add state support