added api routes and api specific .js file. Added register form and functionality w/ errors