The mongoengine auth example won't work TypeError and AttributeError

Steps to reproduce:

Create the virtualenv and do the regular installation:

    pip install https://github.com/mrjoes/flask-admin/archive/master.zip
    pip install flask-mongoengine
    pip install flask-login

* go to the examples/auth-mongoengine directory and launch the app with python auth.py
* point the browser at http://localhost:5000/register/  and create try to create a user
* if you have an existing user go to http://localhost:5000/login/ and it will also show the same error

These are the issues fixed:

        raise TypeError(repr(o) + " is not JSON serializable")
    TypeError: ObjectId('523b1c4b0840396b6b33c665') is not JSON serializable

And:
    
    AttributeError: 'module' object has no attribute 'validate_form_on_submit'