ajout gestion accept json + refactoring