Fix NPE in restore REST call

Please review. 

Thanks.