use PMGJSONEncoder so numpy arrays are properly encoded