bug fixes on REST