Refactoring: using JsonController.