fixes on ResourceData
added server error handling and propoper http codes