Fix route for creating resources.
make cookie work