smaller code refactoring

- docs
- better error handling
- add exception class for client
- do error handling inside client, catch exception from outside
- put code into smaller methods to get out of spaghetti code for command classes