Created this.setEndpoint()-function