Started working on the REST api, refactored some names.