Mapping API Resources & Handling Pagination Discussion
I can't see enough code to give a solid reply, but most likely you are trying to return an array of objects, in which case you need to use the Collection class to map as an array first.
Brandon replied