Extensions of functions on product spaces