api updated to return primary keys (ids or slugs) for nested resources