Improve error handling in api files

Change-Id: Ib9dccf5641d72aa5d16ad3179d0df030c7664fa6
Closes-Bug: #1364018
Fix couple tests in test_engine_service.py

- Function _validate_new_stack gets only Template objects so in test
  should pass correct object.
- Resources should be presented as dictionary, not list.

Change-Id: I264089c15680e97a2b5099f9ceee2a398eca592e
Do template validation during creation

During create we should handle exceptions same as for template
validation. This change will allow correct display of mistakes in a
template after a failed create attempt.

Change-Id: I55c5197533a25c93c5c61953a05c2276ada52fc1
Closes-Bug: #1363093
Merge "Improve error handling in api files"
Merge "Fix couple tests in test_engine_service.py"
Merge "Do template validation during creation"