Updated broken references
Code refactoring
Fixed sample app's publishR routes
Code refactoring