Improve bin/api error reporting.