catch drupal errors and fix CURL options in api client. fixes #2. fixes #3.