Update $resource documentation

Added closing pre tag

Fix example using promise