Implemented legacy API with tests.