Added server start and stop events. Tests.