Stocks built upon slight gains by mid-afternoon Wednesday as a crude rally energized oil stocks. 

The S&P 500 was up 0.03%, the Dow Jones Industrial Average gained 0.02% and the Nasdaq added 0.12%.

Crude oil rebounded from recent lows on Wednesday despite an unexpected increase in the number of barrels of crude in domestic inventories. The Energy Information Administration reported that U.S. crude oil inventories increased 1.4 million in the past week.

West Texas Intermediate crude climbed 3.4% to $40.85 a barrel. Crude hit its lowest level since April on Tuesday on continued fears over a domestic supply glut, weaker demand and ballooning output overseas.

The energy sector was the best performer on markets Wednesday, though gains were not seen across the board. PetroChina(PTR) - Get Report , Petrobras(PBR) - Get Report , and Kinder Morgan(KMI) - Get Report were higher, while Exxon Mobil(XOM) - Get Report , Royal Dutch Shell (RDS.A) , and Total(TOT) - Get Report remained slightly lower. 

Another selloff in crude oil and a disappointing July for automakers kept stocks firmly in the red on Tuesday in what has been a disappointing start to August. The selloff pulled the S&P 500 and Dow from record highs set in July. The Dow has endured seven days of losses, while the S&P 500 has fallen for two.

The private sector added 179,000 jobs in July, according to the ADP Employment Report. Economists expected 165,000 jobs to have been added last month after 176,000 were added in June.

The official jobs number from the Labor Department, the most closely watched economic data each month, will be released on Friday morning. Economists expect the pace of jobs growth in July to slow after a blockbuster gain in jobs added to the U.S. economy in June. TD Securities analysts expect 188,000 jobs to have been added, while the unemployment rate will likely hold at 4.9%. The U.S. economy added 287,000 jobs in June.

The services sector continued to expand at a solid pace in July, according to the latest ISM Non-Manufacturing Index. The measure fell to 55.5 last month from 56.5 in June, though remained above the 50-level, indicative of expansion. New orders increased to a robust 60.3. A separate reading on the services sector from Markit out Wednesday also showed robust growth.

The Federal Reserve leveled a $36.3 million civil penalty against Goldman Sachs(GS) - Get Report on Wednesday morning for the unauthorized use of confidential information. The charges centered on former associate Rohit Bansal who previously admitted to obtaining documents by illegal means. Bansal plead guilty to a misdemeanor charge in March. 

In earnings news, Time Warner (TWX) rose nearly 3% after surpassing quarterly profit estimates. The media company earned an adjusted $1.29 a share over its second quarter, above estimates of $1.16 a share. Sales of $6.95 billion came in short of estimates of $7.06 billion. Time Warner also disclosed it has invested in a 10% stake in streaming service Hulu.

Etsy(ETSY) - Get Report reported a quarter of sales and user growth, even as a net loss came in wider than expected. The online crafts site said revenue rose 39% to $85.3 million, adding to first-quarter growth of 40%. Consensus was for $81 million in revenue. Etsy reported a net loss of 6 cents a share compared with an expected net loss of 1 cent a share. The stock added 12.4%.

Fitbit(FIT) - Get Report edged past earnings and sales estimates in its second quarter. The fitness tracker developer earned an adjusted 12 cents a share, a penny above forecasts. Revenue surged 47% to $587 million. The company also guided for third-quarter sales between $490 million and $510 million, in line with consensus of $497 million. Fitbit said it sold 5.7 million fitness bands and other devices in the second quarter. The stock rose 14%.

Electronic Arts(EA) - Get Report was slightly higher after a better-than-expected first quarter. The video game retailer earned 7 cents a share, a surprise profit to analysts expecting a net loss of 2 cents a share. Revenue fell 1.6% to $682 million, but came in above forecasts by $31.3 million.

Office Depot(ODP) - Get Reportreported a mixed quarter on Wednesday morning. The office supplies chain earned an adjusted 3 cents a share, half what analysts expected, though sales topped estimates. The retailer also announced that it was exploring strategic alternatives in Europe. The stock rose 4.9%.

AIG(AIG) - Get Report increased 7% after upping its buyback plans amid pressure to break itself up. The insurance company said it plans to buy back $3 billion in shares, adding to the $3.2 billion already returned to shareholders over its second quarter. Earlier this year, AIG appointed hedge fund manager John Paulson and a Carl Icahn-picked member to its board after breakup pressure.