fix POST behavior in rest API