Add methods for profile and edit profile views, some other tweaks

A proper http status code as our convention is to report every error by http status codes.