Rename API functions and throw errors

Yes, exactly. This test reads a file generated by another test and if that test fails this test fails but is hard to debug because you don't expect the input to be bogus.  The text of the input was "undefined".  So the bug is poor test setup.