Added and refactored for syn.setendpoints method.
Added extra exception handling for login method.