Refactoring State endpoint to be a core component of the Main Handler: fixing tests.