Refactor Rails controller for cleaner JSON response