GET API support with tests. Also some minor code cleanup.