refactor to use Resource class
rest: accept JSON resource object input