Bugfix - Correctly Checking Data in Response

Before the ApiResponse method was checking via a ternary, which makes use of php's [empty function](http://php.net/manual/en/function.empty.php). This causes an issue when `getData()` returns an empty array since it will just be cast to an empty stdObject. This PR fixes the issue by strictly checking if `getData()` returns `null`.

Now a client that is expecting an empty array in a response rather than an empty object during encoding won't get confused.