Listen and react to server events