add resource hander and fix resource controller