[WIP] Add organizations JSON HTTP API handler

This is a great idea, created a PR so we can keep track of it, it has many loose ends, but shouldn't be hard to polish up.