Atomically thin transition metal layers: Atomic layer stabilization and metal-semiconductor transition