refactor rest models (WIP)