added the code for Controller for Barter DB, basic still needs changes