Added optional json validation to consumer