WIP refactor REST