json working and states