[Github Issue #14] Error handling for JSON requests in PHP.