Add FetchEvents code.