Fix JSON typos
Refactor controller and model