refactored json controller + view