Improve endpoint template