Server module

Replaced prints with the notification API and cleaned up the code.