get_resource function

Get JSON for a resource (URL). Authenticates if necessary