Adding listeners on the server side.