implement rest server