Restful API refactored to use one type of model