qt: fixed API server to output something approaching valid HTTP