removed internal static variable 'api' to allow for multiple instances in same context