changed files/added API functionality for random