return to correct server URLs, not localhost
get content-type correct, catch bad-JSON errors in response
submit body correctly, catch HTTP errors on response