Implemented missing methods of Repository

Added missing methods in Repository class and added testcases for
implemented methods.
stuff... no idea...
added model from DB
Removed DB calls from extension method

removed the DB calls, the value needs to be delivered as a parameter
instead.
Removed unused field.