changed order of status message
flatten structure before sending to json