updated query api to use IQueryable interface