Convert all returns for REST API to JSON.