Updated error handling, added encrypted passwords for prod.