parse body only on successful api requests

Parse body only only if on successful requests.