Fixed #101. Filled in _check_plan_workflow(..) logic.

The logic follows the description in #101. Added a few tests to
test_api.py expecting failure.