Simplified the client. Added some paras validation. Removed some functionality which is not really needed. Tests for params validation. Better comments.