working in first version of eventapi, with unit tests. not finished yet