Separating the methods in Export to Json and MySQL