Rearranging code for creating, updating and deleting resources. Adding e...

...rror messages when trying to create resources when missing needed parameters.

Many changes are rearrangment of code from the update-method to the methods update_resource, create_resource and delete_resource. Also error messages has been added.