Add the alerts API for the client-server communication

For now we will not do automated alerts from the server, which we should do at
some point in future. Alerts will only be sent when there is a user logged in to
the system, which does not make any sense, but it is easier.