Rename newRequest -> handleRequest, split ajax code into own function