Implemented disconnect api