Add more test coverage and complete rest interface.