When copying a hash, pass the api through to the new object

When the copy() method is called on a hash object it copies the context but does not preserve the API. Now it does.