Expect json from server, send form data to server