response and getResponse functions