WIP -- tests are broken, but API UI now handles many cases. Need to refactor legacyapi support