Added query method to Database Class