Fix so that the user can decide which endpoint to connect to.