Api does a datomic query