@PUT
 @Path("/{id:[0-9][0-9]*}")
 @Consumes("application/json")
 public Response update(@PathParam("id") Long id, Event entity) {
   entity.setId(id);
   entity = em.merge(entity);
   return Response.noContent().build();
 }
 @POST
 @Consumes("application/json")
 public Response create(Event entity) {
   em.persist(entity);
   return Response.created(
           UriBuilder.fromResource(EventEndpoint.class)
               .path(String.valueOf(entity.getId()))
               .build())
       .build();
 }