XNAT REST calls; works but may need some clean up