[fix] Return a string on log in/out in the api for json encoding