changed naming to reflect factory nature of exported functions
fixed response object reference passing in the factory method