moved encryption code to a separate file. added test page for metrics apis