Send plain objects to the API method

Fixes issue where empty form data is getting POSTed to the API.

/cc @hampelm