build the rest server