Fixed API connect method