Fixing issues with RestMS implementation