Fix initalizer.

Still needs
+ Fix code, it's horrible
+ verify ssl.
+ DRY the code