Validate json mode

Add the function to validate json file