more validation in JSON object and array constructors