Added json api

Resolves #6 
Yeah :( I tried passing the string in and it didn't match anything.