Change interface to speak JSON.
Parse json arguments.
Add helper function.