Now have basic JSON API. Fixes #16