API: added onConnection().