Implemented full api for deal data, and part of the tests.