Fix type
Re-asign keys when sorted (fixes broken {mustache} loop)
Make resource as flat as possible (confronted with JSONAPI.org)

See: http://jsonapi.org/format/#document-structure-resource-relationships