Provides an API to execute a fallback function at certain events