Moving postMetricsToServer()

Moving postMetricsToServer() so that its declared before its assigned to
"postFunction"