Changed basic structure of how methods are attached to remove dependency on methodnames list. Methods with the same name as their endpoint can now be called like api.endpoint();  Improved the way requestheaders are handled.