Add API support for filtering by ID and relationship types