add before_action and use where instead of find

- Used before_action before member actions
- Used find instead of where as the latter would raise `ActiveRecord::RecordNotFound` exception when the record is not found and it is not a good practice to rescue Exception at many places in your. Use #where instead and redirect to the root_path when the project is not found.