calls db and returns an array of objects