R: updated wrapper functions for API calls.