Refactor array_intersect_key from ApiResult.php to GlobalFunctions.php