make validator throw better error on invalid JSON