Make OTAPI more benevolent

Return error code instead of terminating process