best practices for api integration