server: refactor client

To be more readable and get rid of false error message.
server: add standby