Moved all inserts to methods on the server
Fixed some issues with inserts and moved update to server