Pass credentials as well (needed for the ajax workaround)

Changing it to:
```
def public_fields(o):
    """
    Returns: a dict of fields whose name don't start with underscore.
    """
    if not hasattr(o, '__dict__'):
        return dict()
    return dict((key, value) for key, value in o.__dict__.iteritems()
                if not key.startswith('_'))
```