Implement command api.