bug fixes for rest controller