refactored to use mango-rest