Fix indentation
use internal functions to decide valid rets response and remove unused functions
Move Login data parsing to Login function