cleanup and auto connect to rr api server