added a flag to change port of rest service