Changed server side models module to be more resilient against connection failures