Improve API message handler re-registration check