implement ajax post as a seperate function and convert the form data to a json code
changed to json.stringify to create the json string from the form
finally, converting the form string to json works
initial commit