refactored and refined JSONValidator class to handle nested objects and lists