Fix use of endpoints