Refactor api to use jbuilder

Use JBuilder to separate API JSON presentation into view templates.