Better JSON input validation