public IActionResult DeleteSongFromPlaylist(Guid playlistId, Guid songId) { if (!_sprotifyRepository.PlaylistExists(playlistId)) { return(NotFound()); } var song = _sprotifyRepository.GetSongFromPlaylist(playlistId, songId); if (song == null) { return(NotFound()); } _sprotifyRepository.RemoveSongFromPlaylist(song.PlaylistId, song.Id, song.Index); if (!_sprotifyRepository.Save()) { throw new Exception($"Deleting song {songId} from playlist {playlistId} failed."); } return(NoContent()); }