Allow dynamic response generator for timeouts

There are cases where we are supposed to respond back with custom
information in the response in the event of timeouts. On the other
hand we  don't want to construct the response object unless it's
actually required. This change allows us to defer response creation
until we know it is required.