Added model relations and user authentication