refactored authentication and account check, added test responses to API closes #29