@SuppressWarnings("unchecked")
	@PUT
	@Produces( { "application/json", "application/xml" })
	@Path("/mood/title/{title}/{username}/{valence}/{arousal}")
	public void putMoodByName(@PathParam("title") String title,
			@PathParam("username") String username,
			@PathParam("valence") double valence, @PathParam("arousal") double arousal) {
		
		if(valence>=0 && valence <=1 && arousal>=0 && arousal<=1){
			PersistenceManager pm = PMF.get().getPersistenceManager();
			User user = getUser(username);
			Query q = pm.newQuery("select from " + Experience.class.getName()
					+ " where title=='" + title + "'");
			List<Experience> experiences = (List) q.execute();
			Experience experience = experiences.get(0);
			Event newMoodEvent = new Event();
			newMoodEvent.setId(UUID.randomUUID().toString());
			newMoodEvent.setExperienceid(experience.getId());
			newMoodEvent.setClassName("MoodEvent");
			newMoodEvent.setCreator(user.getUsername());
			newMoodEvent.setDatetimemillis(new Date().getTime());
			newMoodEvent.setShared(false);
			newMoodEvent.setLatitude("0");
			newMoodEvent.setLongitude("0");
			newMoodEvent.setValence(valence);
			newMoodEvent.setArousal(arousal);
	
			try {
				try {
					experience.getEvents().add(newMoodEvent);
					pm.makePersistent(experience);
				} catch (Exception e) {
					// TODO: handle exception
				}
			} finally {
				pm.close();
			}
		}else{
			//Do not insert
		}

	}