changing Add to Commit and adapting State to hold SubState collection
added substates inside states json
marshalling substates