Echo or return result in PHP API call?

Apologies for my lack of details. This is not a fully-fledged API, but just an API call to be used internally in my organization. But I did review requirements with those who would use it, and I resolved my issue. Thank you all!