public async Task<BackgroundEvent> GetLastEventStateForBeacon(string pid) { return LastEventState.ContainsKey(pid) ? LastEventState[pid] : null; }