class ScreenService extends BasicService implements OwnerAPISupport<Screen> {

	@PUT
	@Path("/screens/{id}/requestedOwner")
	@Produces(MediaType.APPLICATION_JSON)
	public Screen updateRequestedOwner(@PathParam("id") long screenId, Screen screenData) {
		if (!isAdmin()) {
			throwUnauthorized();
		}
		Screen existingScreen = new ScreenDAO().getById(screenId);
		if (!existingScreen.getOwners().isEmpty()) {
			throwBadRequest();
		}

		existingScreen.setRequestedOwner(screenData.getRequestedOwner());
		existingScreen = ScreenDAO.save(existingScreen);

		if (existingScreen.getPlaylist() != null) {
			existingScreen.getPlaylist().expand();
		}

		return existingScreen;
	}

}