add format string to query.py, change response body if 404