destroy and errors for json

see #2