converted resourceserver to a lib
fixed merge