WIP: first prototype of the JSON API.

 * Tests not included, so I cannot prove that it works