Completed the API and the tests