Error messages and simplification of json when creating