Safely access the RStudio API.