Added unittests for client. Addressed Ben's feedback.