error handling, cleanup and addition of client listeners for the network