add validateJson() function

Also added json customMessage error