Fixed Repositories, built sql methods up to service layer, and added tests for sql methods