Made javascript latencies be calculated properly for api endpoint