functions implemented to call from REST, also leading 0's and full tests implemented for StartUp and OnlineTest.
If OnlineTest = false, StartUp get called. If StartUp = true the last generated number which failed OnlineTest will be used to not manipulate the RNG with the tests.