fixed sort error
Added RESTful routes
fixed bug in code: too man redirects