             app.run()
             $('#aule').show()
             $('#loading').fadeOut 'fast'
-        dataType: 'json'
+        error: =>
+            $('#loading').append $('<div class="modal-error"><p class="alert alert-error"><strong>Error:</strong> Could not connect to server</p></div>')

        options.type ?= 'GET'
        options.beforeSend ?= (r) -> null
        $.ajax uri,
            beforeSend: (r) => addAuth r; options.beforeSend r
            data: options.data
            success: options.success
            error: options.error

    addAuth = (r) =>
        r.setRequestHeader 'Authorization', makeBasicAuth @login, @password

    # Add Accept-Version header to request
    addVersion = (r) =>
        r.setRequestHeader 'Accept-Version', ACCEPT_VERSION

    addRange = (page) =>
        start = page * @pageSize
        end = start + @pageSize - 1
