Controller for JSON output