json: implement the state api
json: adding comment about the special function