Based on jsdb http tutorial