fixing bug with autodiscover endpoints and function format not working