Random API work in progress + some changes.