Added json api

Resolves #6 
what does the reply look like for this?