Adding logging capability + memmory segmentation issue fix for response