Json errors

Closes #240