add primitive REST API

support for JSON and ASCII output formats