added authentication system to sync.php