Optimised crystal structures of the organometal hybrid perovskites CH3NH3PbI3 (MAPI) and NH4PbI3 (API)