Changed type as http method rather than 0 and 1 for get and post. Now supports delete, put also as type is a string of "get", "post", "delete" and "put"