I del with an API that sometimes gives me an item and sometimes an array of items for nearly all its endpoints. I generally turn the single results into arrays and then work form there in the rest of the app.
i.e. I would do this:
$t = $period[‘Paragraph’];
$period[‘Paragraph’] = array($t);