implement RESTful backend service.
front end now uses agility.js