cleanup state funcs

- close clients on ws shutdown
- specific funcs for setting parts of state