Change API output and fix up tests.