API calls break when data directory is changed

Hi everyone!

I installed nextcloud via snap and I changed my data directory on my nextcloud server and ever since then my API calls that used to work perfectly fine throw me an:

requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

I’m pretty sure it is the changing of the data dir since I haven’t changed anything else… Is this expected behaviour or is there a setting that I need to change for the API calls to handle the changed data dir?

Thanks so much for any help. Very much appreciated.