Fix chain locks

@srimanob : this fixes the lock you have experienced earlier today on second submission. the lock on submission was not released.
Added are locks/release on chain testing.
Fix import within chaininject api (for admin)