Updated ajax code to update status - now takes status code