BS-7101, clean login api: better exception handling