build response handling