Move everything in the func into one execute sub-method which calls sendResponse (reply would be more consistent with our one word inner methods). The code needs to appear in execution order...