Improved API
Started implementing support for close events.