Update api.php

Adding SSL support