refactor RESTful response