Fixed API for update to database