bug fixes, rest controller improvements