cleaned code, added support for lists and complex fields (https://github.com/restlet/apispark/issues/2199)