core.DBObj.php: allow POSTing of JSON data
api.js: support file upload and JSON payloads