added bootstrap for tests, added QueryException