Add before and after methods in app.rb