Finish implementing rest api working on tests