fixed some QueryBuilder methods such as count

and built some queries for filters