public Order createOrder(Order order){
		
		String symbol = order.symbol;
		
		ACTION action = null;
		if(order.type == TYPE.BID){
			action = ACTION.BUY;
		} else if(order.type == TYPE.ASK){
			action = ACTION.SELL;
		} else {
			//not expecting this case
			System.err.println("Creating order and order type is not BID or ASK!");
			return null;
		}
		
		double price = order.price; 
		long quantity = order.quantity;
		String id = null;
		
		symbol = symbol.trim();
		
		HashMap<String,String> var = new HashMap<String,String>();
		var.put("symbol", symbol);
		var.put("price", ""+price);
		var.put("units", ""+quantity);
		if(action==ACTION.BUY){
			var.put("action","buy");
		} else if (action==ACTION.SELL){
			var.put("action","sell");
		} else {
			//not expecting so return null
			return null;
		}
		
		String result = apiCall(CMD.ORDERCREATE,var);
		JSONObject jsonStatus = new JSONObject(result);
		String status = jsonStatus.getString(STATUS);
		//check if request was successful
		if(!status.equals(OK)) return null;
		id = ""+jsonStatus.getLong("id");
		
		order.id = id;
		
		return order;
	}