add rest api and json support
use two spaces for json in test app
add tests for rest api and json communication
update readme with rest documentation