Add lifecycle event handlers

This should be done as a part of serverSetupChecks() or straight after it not after the server is started.