changed response encoding to JSON