Set correct endpoint