class PlaylistService extends BasicService implements OwnerAPISupport<Playlist> {

	@POST
	@Path("/playlists/{playlistId}/playlists")
	@Consumes(MediaType.APPLICATION_JSON)
	public Playlist addPlaylist(@PathParam("playlistId") long playlistId, Playlist playlist) {
		Playlist existingPlaylist = getExistingPlaylist(playlistId, true);
		Playlist existingPlaylist2 = getExistingPlaylist(playlist.getId(), false);

		existingPlaylist.addPageReference(new PageReference(existingPlaylist2));

		return PlaylistDAO.save(existingPlaylist);
	}

}