basic json input, detecting valid data