Use global to pass callback, return endpoint