Refactor HTTPRoute and extract callback into a class.