Bugfixes and almost working json validation