Add SSL in production
code clean up, tests added