Redirect to referrer if search is invalid
Fixing 404 and 500

Also removed some cruft from Index view