Server: implement heartbeats and starting elections