fix passwords retrieval; fix malformed json handling