Hello,
Works now – sorry but it probably was me being a bit too tired and irritated with WordPress. 🙂
For future reference – if anyone else gets a warning about a foreach-loop not working in api.php, it’s probably because you aren’t really formatting your data in the way that the API wants to, which was the case for me.
Best regards,