Added method property to item so that PUT can be used as well as POST.
Updated status code check so that 201 (Created) status code is a success.