use current_app json encoder instead of flask.json

This makes it possible to use a custom JSON encoder