Revert "client improvements: added more checks, diagnostics messages"

This reverts commit 8d6c74e62fb814beec1af10b286633bc289a8e36.
Revert "Revert "client improvements: added more checks, diagnostics messages""

This reverts commit 85d12fc45e3924d27be8047a83850fd7c6d26a6f.
Revert "fixing overflow issue, error handling, proper logging, adding comments"

This reverts commit 7a1b4016e21e1862c1318a312e9704fc7e0b1ff5.