Solution based synthesis of layered lead halide perovskite semiconductors for optoelectronic applications