Fixing index.js so that it defaults properly when no pages exist in db.