Migrated from simplejson to json

and minor error check in manager