master: implementation of the resource server