Added code for consumer side

Still need one more test class...