Integration with the API and fixes for Safari