Added json api

Resolves #6 
k, that'll work