Refactored code on grader.js to resolve issue where GET was not finished before the program could run correctly