getAllData works now

Excluded the "insertMessages.php" because it causes a parsing error.
Changed the "Doubled Array" to one object (check Line 43)....Maybe it has to be also applied to the other functions.