Added code to parse messages responses