Use accessor instead of ivar
Add tests for api_object