connect/disconnect API