Getting objects and nested arrays working