Small fix on rest integration test
Move REST server initializaiton to a funciton