Added a big consistency check for all json rest queries