modified echo.js controller, added a method to return json