database: Add interface to handle transactions