refactor projects_controller to use state machine