Element API - Order results by Category
This seems more like it may be an error in your code somewhere, do you have dev mode turned on?

I think you may want to output the title of the category:

'hostingCompany' =&gt; (string)$entry-&gt;hostingCompany[0]-&gt;title,


See if that helps, if not I would update your question with your complete element-api.php