Fixed backup_site and restore_site endpoints, and added tests. bugid:112565