Add case when server response is `badClass`.
Use `switch` instead of `if`.