Added object to array conversion to initialize's models parameter and corresponding test