Fix api.resource interface