Use jQuery's each() function instead of Array.forEach(). Also simplify an if statement.
Simplify the api output normalizing step.