// curl -X POST -H 'Content-Type:application/json' --data '{"name":"test",
 // "tags_vector":{"wedding": 2}}'
 // http://localhost:8680/rest/user/
 @POST
 @Path("/update")
 @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 public boolean updateUser(User user) {
   return user.getId() != null && api.updateUser(user.getId(), user);
 }
 // either add or update
 @POST
 @Path("/")
 @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 public String addUpdateUser(User user) {
   if (user.getId() == null) {
     System.out.println("adding user " + user);
     api.addUser(user);
   } else {
     System.out.println("updating user " + user);
     api.updateUser(user.getId(), user);
   }
   return user.getId();
 }