add 404 and 500 error handling, fix bug of duplicated nickname when editing profile