Implemented ack() and nack() subroutine according to specification.
Added simple error handling and support for transactions.