Make OTAPI more benevolent

Return error code instead of teminating process