Fix exceptions, add module refactor
Fix json dumps