Molecularly thin two-dimensional hybrid perovskites with tunable optoelectronic properties due to reversible surface relaxation