Java servlet that processes Ajax (XHR) requests and returns JSON reponses