Added more magic to chaining of endpoints