code cleanup and various request functionality added.