Added json api

Resolves #6 
Is it required to convert this?