refactored model.php (getSitesFromIds and getNumberOfSitesFromIds)