Add events for setting and unsetting loading state