added __json__ and test