Refactored for new RESTful API.