Adding query building
Adding query checking