Define api wrapper functions

Define api wrapper functions.
Start define more abstract json interface.