@Override
    public Person delete(Integer id) throws NotFoundException {
        EntityManager em = emf.createEntityManager();
        Person person = em.find(Person.class, id);
        if (person == null) {
            throw new NotFoundException("No person exists for the given id!");
        }
        em.getTransaction().begin();
        try {
            em.remove(person);
            em.getTransaction().commit();
        } catch (Exception e) {
            em.getTransaction().rollback();
            person = null;
        } //finally {
//            em.close();
//        }

            return person;
        }