Implement new RESTful api with tests.