Add start of front-end JSON API.

This ticket is just to get the initial framework and maybe a few example methods in place. Specific API feature requests can come later (although of course suggestions for API methods are welcome here too -- I'll likely create tickets for them).