Set up factories for ajax calls