fixed controllers, added migrations and joint tables