Validate the --detect-local-mode value in the API object validation rather than doing it separately later. Also, remove runtime checks and unit tests for cases that would be blocked by validation