Added shiro support and exception handling.