Refactor database connection
Return number of imported objects from JSON import method