Making a generic events API