Implemented JSON validator, better debug, minor fixes