check if file is found in database and if not return 404