Finish implementing the REST api