Rest controller bugfixing