lots of optimizations to rest controller
more optimizations