todo: send state object as json