refactored response's convert methods and add invokeFunctionForType
method to consumer.