Updated usage of logger.
Added error handling to initialization of client and server.