Implemented JSON API v1.

Closes #2