client js: added callback function to options array. The provided function will be called, when every a connection has been established