ensure that http response is correctly passed to functions (fix #103)