US stock markets end in green