Resolved issues with and improved error handling

- Resolved error where the API error handler would fail ungracefully due to json.dump call
- Improved debug dump output
- Added delay in retry loop
- Added arguments for retry behavior
- Improved help output