updated to support array inputs, responses