Fix org repo settings, and org repo related code in api2