Handling requests with 'view' function