Implement saving AnalyticsEvents in local database