Added initial_state field and its validation
Dynamic code for creating request state_machine