Fixed the delete method and implemented the exists method