Added event for API change

After API is changed the program must be restarted. Added events to
manage it correctly.