now checks if data from server is object or array, removed dev logs