fix drupal warning
Fix bug listing resources, use more robust json generation code
Cleanup whitespace
Fix for resource editing breaking resources