Added request to all view functions
Minor refactorings