use flask.json

Fixes #207 by using `flask.json` instead of the regular `json` library.