add in a json api
Merge pull request #1 from andymckay/add-api

add in a json api