[webui][api] moved field checks to controller, updated test functions and some more refactoring.