Bill 53: Fix API Crash (PR #318)

PR Closed

Submitted by: mfosterw

And add regression test. I added an assert to silence a mypy error without realizing that the type error wouldn't cause a crash but the assert would.

Diff: +10 -3