Python api files_write HTTP 500 error

Traceback (most recent call last):
  File "C:\Users\phill\AppData\Roaming\Python\Python37\site-packages\ipfsapi\", line 166, in _do_raise_for_status
  File "C:\Program Files\Python37\lib\site-packages\requests\", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 39, in <module>
    api.files_dir_add('/', {'test': 'test'})
  File "", line 35, in files_dir_add
    self.api.files_write(ipfs_path, buffer, create=True)
  File "C:\Users\phill\AppData\Roaming\Python\Python37\site-packages\ipfsapi\", line 2061, in files_write
    data=body, headers=headers, **kwargs)
  File "C:\Users\phill\AppData\Roaming\Python\Python37\site-packages\ipfsapi\", line 38, in wrapper
    return func(self, *args, **merged)
  File "C:\Users\phill\AppData\Roaming\Python\Python37\site-packages\ipfsapi\", line 245, in request
    files, headers, data)
  File "C:\Users\phill\AppData\Roaming\Python\Python37\site-packages\ipfsapi\", line 195, in _request
    self._do_raise_for_status(res, ret)
  File "C:\Users\phill\AppData\Roaming\Python\Python37\site-packages\ipfsapi\", line 175, in _do_raise_for_status
    six.raise_from(exceptions.StatusError(error), error)
  File "<string>", line 3, in raise_from
ipfsapi.exceptions.StatusError: HTTPError: 500 Server Error: Internal Server Error for url:```

Running the linked file yeilds a 500 error from the files_write call.
Can annyone tell me whats causing this? Also how does one evne go about debugging a raw 500 error like that? I tried enabling debug level for several of the logging susbsytems, but none of them output any relevant info.

Figured it out forgot to append the filename to the folder path. You can’t write to ‘/’ or any other dir.
However the error message is also singularly unhelpful :C