Refactor tests and Implement request state updating