added initial (yet low-level) query interface for the database