making class registration page work both in ajax and as a normal url