better id management
improved json
undo fixes