Testcase for Grill Cli and Grill Client.

Fixing misc bug fixes in the code which were not caught in testing.


result should contain a prepare handle as well. Can we add an assert for that?