Add explicit states, reconnecting and graceful server restarts