Added listener classes and support to listen for events on the server.