Fixed typo in api.rst

Replaced 'enviroment' with 'environment'