Refactor into an API Controller. Just before Part 4