Added logic inside template
Added 404 error for when page number exceeds boundaries
Handled routing for pages