Use the API correctly for a more robust way of locating a layer data directory