Use angularjs  to replace cookie and config some api resources in route.rb