Fig bugs and improve logging in API server.
Add API methods (list, hasMore, etc.).