Created joins between tables and input validation