Update save function to proper status code