set up basic ajax spinner loading and error handling