refactor, use show() and hide() instead of display:none and display:block
refactor, compile templates in class property
clean code, remove unused arguments
refactor, use ajaxError() for api errors
clean code, remove indention