Improve fetching items with high limits

This PR will fixe a minor PHP error if the GET request fails and does not return an array and a check was added to break the while loop if the last data set is retrieved from redmine.