Protection against invalid JSON, properties that aren't objects, and fixed the URL handling for GET.