Improve API error handling, update example config