Test for 404 response when no dashboard found

also fix pep8 issues