validation for input and output json