301 response and json response wrapper functions

Added two helper methods, one for 301 response and another for json response