Fix bugs in action handling

In some cases `wait` failed for having an invalid status object.

Some language bindings, or at least Python, inserts the `sessionId` into the body of a post, which would make the controller code fail. Check for this, and get the actions appropriately.