adds quotes and error check to query string in get_all_subjects() & get_subject_by_id()