move json format and validation to api
add basic tests for json
Merge pull request #71 from brettlangdon/json-api

Json api