Added check before inserting user on whether user already exists, avoids SQL errors. Also send feedback to browser.