Django Rest Framework Many To Many serializer problem

I’m creating an API in Django Rest Framework and I have a problem with a ManyToMany relation.

I’m trying to create an movie and assign genre to it (ManyToMany relationship between movie and genre).

Here are my models:

class Genre(models.Model):
    id = models.IntegerField(primary_key=True)
    name = models.CharField(null=False,blank=False,max_length=50)
    
    def __str__(self):
        return self.name

class Movie(models.Model):
    id = models.IntegerField(primary_key=True,null=False,blank=False)
    adult = models.BooleanField(null=False,blank=False)
    backdrop_path = models.CharField(null=True,blank=True,max_length=200)
    budget = models.BigIntegerField (default=0)
    homepage = models.CharField(null=True,blank=True,max_length=200)
    original_language = models.CharField(max_length=10)
    original_title = models.CharField(max_length=200)
    overview = models.CharField(max_length=1000)
    poster_path = models.CharField(null=True,blank=True,max_length=200)
    release_date = models.DateField(null=True,blank=True,)
    revenue = models.BigIntegerField (default=0)
    runtime = models.IntegerField(null=True,blank=True)
    status = models.CharField(max_length=50)
    tagline = models.CharField(null=True,blank=True,max_length=100)
    title = models.CharField(max_length=200)
    genres = models.ManyToManyField(Genre,blank=True)
    
    def __str__(self):
        return self.title

here are my serializers:

class GenresSerializers(serializers.ModelSerializer):
    class Meta:
        model = Genre
        fields = ['id','name']
        
    def create(self,validated_data):
        
        instance, _ = Genre.objects.get_or_create(**validated_data)
        return instance
    
class MovieGenreSerializer(serializers.ModelSerializer):
    class Meta:
        model = Genre
        fields = ['id']
        
    def create(self, validated_data):
        instance, _ = Genre.objects.get(**validated_data)
        return instance
    
class MoviesSerializer(serializers.ModelSerializer):
    genres = GenresSerializers(many= True)
    
    class Meta:
        model = Movie
        fields = [ 'id', 'adult', 'backdrop_path', 'budget', 'homepage', 'original_language', 'original_title', 'overview', 'poster_path', 'release_date', 'revenue', 'runtime', 'status', 'tagline', 'title', 'genres'
            ]
        # extra_kwargs = {'id': {'read_only': True}}
        
        
    def create(self, validated_data):
        genres_data = validated_data.pop('genres', []) 
        
        genresInstances = []
        for genre in genres_data:
            genresInstances.append(Genre.objects.get(pk = genre['id']))
        movie = Movie.objects.create(**validated_data)
        movie.genre.set(genresInstances)
        return movie

and my viewsets:

class MovieViewSet(viewsets.ModelViewSet):
    queryset = Movie.objects.all()
    serializer_class = MoviesSerializer

When I try to create a new movie with this request body (I already have created genres):

{
  "id": 425,
  "adult": false,
  "backdrop_path": "/kK5OeulwVDniPgjNOGHvzcORzdG.jpg",
  "budget": 59000000,
  "homepage": "http://www.iceagemovies.com/films/ice-age",
  "original_language": "en",
  "original_title": "Ice Age",
  "overview": "With the impending ice age almost upon them, a mismatched trio of prehistoric critters – Manny the woolly mammoth, Diego the saber-toothed tiger and Sid the giant sloth – find an orphaned infant and decide to return it to its human parents. Along the way, the unlikely allies become friends but, when enemies attack, their quest takes on far nobler aims.",
  "poster_path": "/stQoHvo0q6ZcEkji2Z1wlAxKnDq.jpg",
  "release_date": "2002-03-10",
  "revenue": 383257136,
  "runtime": 81,
  "status": "Released",
  "tagline": "They came. They thawed. They conquered.",
  "title": "Ice Age",
  "genres": [
    {
      "id": 16
    },
    {
      "id": 35
    },
    {
      "id": 10751
    },
    {
      "id": 12
    }

  ]
}

it return like this:

{
  "genres": [
    {
      "id": [
        "genre with this id already exists."
      ]
    },
    {
      "id": [
        "genre with this id already exists."
      ]
    },
    {
      "id": [
        "genre with this id already exists."
      ]
    },
    {
      "id": [
        "genre with this id already exists."
      ]
    }
  ]
}

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật