add before do for allow access control allow origin and methods and add in all endpoint content type json