Added stat api! Also intergrated MySQL!