# API not returning data

**URL:** <https://forum.mautic.org/t/api-not-returning-data/30686>\
**Category:** Mautic 5 Install/Upgrade Support\
**Created:** [January 27, 2024, 9:01am UTC](https://forum.mautic.org/t/api-not-returning-data/30686 "2024-01-27T09:01:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vog](https://avatars.discourse-cdn.com/v4/letter/v/f14d63/32.png) [@vog](https://forum.mautic.org/u/vog)\
**Post date:** [January 27, 2024, 9:01am UTC](https://forum.mautic.org/t/api-not-returning-data/30686/1 "2024-01-27T09:01:43Z")

</div>

**Your software**  
My Mautic version is: 5.0.2  
My PHP version is: 8.0.30  
My Database type and version is: MariaDB 10.6.16-MariaDB-0ubuntu0.22.04.1

**Your problem**  
My problem is: When using the API I get a result but each item in the result is empty

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/3/3d88708c1ecf7937456eccfd9ee22194ff53864e.png)

These errors are showing in the log:

There don’t seem to be any in:  
/var/log/apache2/error.log  
/var/www/html/var/logs/mautic\_prod-2024-01-27.php  
/var/www/html/var/logs/prod-2024-01-27.php

Steps I have tried to fix the problem:  
Unsure where to start! This is a fresh install of Mautic 5 with composer. I’ve added some custom fields & imported some data. The API was working on Mautic 4 before I broke it 😑

---

<div class="post-metadata">

**Author:** ![vog](https://avatars.discourse-cdn.com/v4/letter/v/f14d63/32.png) [@vog](https://forum.mautic.org/u/vog)\
**Post date:** [January 27, 2024, 11:38am UTC](https://forum.mautic.org/t/api-not-returning-data/30686/2 "2024-01-27T11:38:37Z")

</div>

Looks like the same problem as this - commenting out those same lines resulted in data being returned:

> [@Rest API in Mautic 5 delivers empty result array but no error](https://forum.mautic.org/t/rest-api-in-mautic-5-delivers-empty-result-array-but-no-error/30596/6):
>
> There is a method in Entity\Lead.php that sets groups for this serializer.
