Fix not receiving events in some cases

The front end might not receive events that occurred while submitting
its own events. This was now fixed. The front end sends its own
LastDataId and the back end checks whether the front end was the last
person to send events or not. If not, it returns the timestamp of the
first event the front end has not yet received.