some new functions for events to store information properly;
refactored event convertion;
added functions for get devices and get events;