Set up ajax for loading api