I think we can make this a bit simpler:

```
var checkServerAvailable = function() {
  $.ajax({
    'url': '/api/me',
    'success': function() {
      document.location = '/me';
    }
  });
};

setInterval(checkServerAvailable, 60000);
```