Implement REST API.

Change-Id: I7b63c692f153d766ddd3ab261bdc0c1715934c0b