Split events into separate files and split API into distinct packages