only send caching header for api requests