<?php

class ResponseHelpers {
  public static function respondNotFound() {
    @header("HTTP/1.0 404 Not Found");
  }

  public static function respondServerError() {
    @header("HTTP/1.1 500 Internal Server Error");
  }

  public static function outputWithJsonHeader($obj) {
    @header("Content-Type:application/json; charset=utf-8");
    print json_encode($obj);
  }
}

<?php

class ResponseHelpers {
  public static function respondNotFound() {
    @header("HTTP/1.0 404 Not Found");
  }

  public static function respondServerError() {
    @header("HTTP/1.1 500 Internal Server Error");
  }

  public static function outputWithJsonHeader($obj) {
    @header("Content-Type:application/json; charset=utf-8");
    $wrapper = array("data" => $obj);
    print json_encode($wrapper);
  }
}

--- 
+++ 
@@ -11,7 +11,6 @@
 
   public static function outputWithJsonHeader($obj) {
     @header("Content-Type:application/json; charset=utf-8");
-    $wrapper = array("data" => $obj);
-    print json_encode($wrapper);
+    print json_encode($obj);
   }
 }
Modify API so responses are no longer wrapped
