Added query builder and query interface to the api