add getConnected method to Javascript Library