handle posts and puts