Added API support for channels.
Added tests.