[api] make sure we PUT packages only once

The code used to save in between and then continue with flags and relationships.