Fix so spec runs and add api support for tests.