Add autotest and edit apphelper