Refactoreds for async fs operations, added json parse error handling