im making a rails api but only the back-end, I created validations and flash messages but they dont show up on insomnia, postman or console.
Are flash messages only supposed to show up in the view of the api?

this is my controller code:

```
    @genre = Genre.create(genre_params)
    if @genre.valid?
      @genre.save
      flash[:notice] = 'The genre has been added successfully!'

      redirect_to genres_path
    else
      flash[:alert] = @genre.errors.full_messages
    end

  end ```

```