Tweak endpoints code