Hey guys, I was taking a look at the code and I saw that the approach you use is different than what the Pantheon people is doing:
It looks like they are using the rest_prepare_xxx filters to add that entity to a global array. That works well with _embed=true because the rest_prepare_xxx filters of the embedded entities are also called.
My question is: why did you choose to extract the entities from the fields present in the response? Is there a benefit from doing so, or did you find that the Pantheon's approach has some edge cases that are not covered?