Rearranged stuff for better security
Fixed error handling so now you can create things too