#6 validating if json is valid before sending POST request