Index: src/webapp/webservice/index.php
===================================================================
--- src/webapp/webservice/index.php	(revision 33c65579baa7345ef0112f48cf051cab18dcde1d)
+++ src/webapp/webservice/index.php	(revision 22f7269c4158c73c67f9d53051a5e9043b9aa641)
@@ -16,4 +16,6 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
+
+xdebug_start_trace();
 
 require_once(__DIR__ ."/inc/Config.php");
@@ -68,11 +70,14 @@
 	$lastTime = -1;
 	$keys = array_keys($data);
-	if(count($keys) < 0 ){
+	$keyTimeframes = $keys[0];
+	$itemCount = count($keys);
+	if($itemCount < 0 ){
 		error_log("No keys in fetched rrd data from ". $dbFile);
 		echo json_encode("");
 		exit;
 	}
+	$timeframesCount = count($data[$keyTimeframes]);
 	if($debug > 0){
-		echo "<p>Variables: ". count($keys) ."; Timeframes: ". count($data[$keys[0]]) ."</p>\n";
+		echo "<p>Variables: ". $itemCount ."; Timeframes: ". $timeframesCount ."</p>\n";
 	}
 	foreach($data[$keys[0]] as $timeframe => $value){
@@ -185,3 +190,5 @@
 }
 
+xdebug_stop_trace();
+
 ?>
