add rest api section to readme
add features to send json when rest is active
use 2 spaces for json output
add tests for rest api